package com.ql.design.adapter.demo2;

import com.ql.design.adapter.Source;
import com.ql.design.adapter.Targetable;
/**
 * 对象的适配器模式:通过委让实现Adapter
 *实现Targetable接口 ，包含Source类
 */
public class Wrapper implements Targetable{
	
	 private Source source;

	//获取原类的对象
	public Wrapper(Source source) {
		super();
		this.source = source;
	}

	@Override
	public void operation() {
		source.operation();
	}

	@Override
	public void operation2() {
		System.out.println("包装目标类后发方法。");
	}
	 
}
